package com.example.restfull.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Created by wuning at 2018/10/22 16:51
 **/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {UserNameValidator.class})//使用UserNameValidator的校验逻辑处理
public  @interface UserNameConstraint {

    String message() default "用户名校验器";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
